package com.xm.controller;

import com.github.pagehelper.PageInfo;
import com.xm.pojo.MedicalReports;
import com.xm.pojo.PageVo;
import com.xm.service.MedicalReportsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class MedicalReportsController {
    @Autowired
    MedicalReportsService service;

    @PostMapping("/insertMedicalReports")
    public boolean insertMedicalReports(MedicalReports medicalReports){
        return service.insertMedicalReportsService(medicalReports)>0;
    }
    @RequestMapping("/deleteMedicalReports")
    public boolean deleteMedicalReports(String archive_num){
        System.out.println(archive_num);
        return service.deleteMedicalReportsService(archive_num)>0;
    }
    @PostMapping("/updateMedicalReports")
    public boolean updateMedicalReports(MedicalReports medicalReports){
        return service.updateMedicalReportsService(medicalReports)>0;
    }
    @RequestMapping("/queryMedicalReportsList")
    public PageInfo<MedicalReports> queryList(@RequestBody  PageVo<MedicalReports> pageVo){
        return service.queryListService(pageVo);
    }

    @PostMapping("/queryMedicalReportsAll")
    public List<MedicalReports> queryAll(){
        return service.queryAllService();
    }
}
